﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.IO;

namespace FileRenamer
{
    public class ActionItem
    {
        public enum ActionType 
        { 
            COPY, 
            MOVE, 
            IGNORE,
            SCANNED,
            NOCHANGE,
            COPIED,
            MOVED,
            ERROR,
            DELETED
        }

        public ActionItem(String source, String destination, ActionType action)
        {
            Action = action;
            Source = source;
            Destination = destination;
        }

        private static Int64 _serialNumber = 0;
        public static Int64 SerialNumber { get { return _serialNumber; } }

        private string _source;
        public string Source 
        {
            get { return _source; }
            set 
            { 
                _source = value;
                _serialNumber++;
            }
        }

        public string FileName
        {
            get
            {
                FileInfo file = new FileInfo(_source);

                if (file.Exists)
                {
                    return file.Name;
                }
                else
                {
                    return "";
                }
            }
        }

        private string _destination;
        public string Destination 
        {
            get { return _destination; }
            set
            {
                _destination = value;
                _serialNumber++;
            }
        }

        private ActionType _action;
        public ActionType Action 
        {
            get { return _action; }
            set
            {
                _action = value;
                _serialNumber++;
            }
        }

        private string _logText;
        public string LogText 
        {
            get { return _logText; }
            set
            {
                _logText = value;
                _serialNumber++;
            }
        }
    }
}
